﻿cmake_minimum_required(VERSION 3.26)
project(GnssLogs VERSION "0.3.1")

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_DEBUG_POSTFIX "d")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/build)
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}/build/obj)
set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
    set(INSTALL_LIBRARYDIR ${CMAKE_INSTALL_PREFIX}/lib/x64)
    set(INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX}/bin/x64)
else()
    set(INSTALL_LIBRARYDIR ${CMAKE_INSTALL_PREFIX}/lib/x86)
    set(INSTALL_BINDIR ${CMAKE_INSTALL_PREFIX}/bin/x86)
endif(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(Boost_NO_WARN_NEW_VERSIONS 1)

if(MSVC) 
  add_compile_options(/W3 /wd4251 /wd4996 /utf-8)
  if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.12.25835)
    set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
    set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++latest")
  endif()
endif()

include(${PROJECT_SOURCE_DIR}/cmake/ExportHelper.cmake)
export_config(${PROJECT_NAME} ${INSTALL_LIBRARYDIR} ${INSTALL_INCLUDEDIR})

add_subdirectory(src)

